# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=cymothoa
pkgver=1
pkgrel=9
groups=('blackarch' 'blackarch-backdoor')
pkgdesc="A stealth backdooring tool, that inject backdoor's shellcode into an existing process."
url='http://cymothoa.sourceforge.net/'
arch=('x86_64' 'aarch64')
license=('GPL2')
makedepends=('git')
optdepends=('bgrep: originally included in cymothea')
source=("http://downloads.sourceforge.net/project/$pkgname/$pkgname-$pkgver-beta/cymothoa-$pkgver-beta.tar.gz"
        'git+https://github.com/BlackArch/cymothoa-bin'
        'warnings.patch')
sha512sums=('7555a28e308fe30d152f51035202e6aae35b045d2440dd99ba29dfa789e9fdd0757794cad8ec80fad6438432f4f217b52f272d57603871bfc23e56f854896843'
            'SKIP'
            '694b8b0960ec095b0783211b33e3f46bfae7af1907e37ebdf8a2a2bb0498707fcfa389039dd63fe06ca07195f691e416976382754c4be56a48f3a61b96d05102')

prepare() {
  cd "$pkgname-$pkgver-beta"

  patch < "$srcdir/warnings.patch"
}

build(){
  cd "$pkgname-$pkgver-beta"

  make
}

package() {
  cd "$pkgname-$pkgver-beta"

  install -Dm 755 udp_server "$pkgdir/usr/bin/cymothoa-udp_server"

  cd "$srcdir/cymothoa-bin"

  install -Dm 755 $pkgname "$pkgdir/usr/share/$pkgname/$pkgname"
}

